namespace ::


type Framework enum {
    React, Vue, Angular
}
method Framework.Color String {
    when(this) { React => 'Blue', Vue => 'Green', Angular => 'Red' }
}
method Framework.Default? Bool {
    (this == Vue)
}
operator == { f1 Framework, f2 Framework } Bool {
    (([Int]) f1 == f2)
}

entry {
    ShowWindow({
        @use framework = ComboBox(each(Framework) {
            React   f => ComboBoxItem(Icon(), 'React',   f, f.Default?),
            Vue     f => ComboBoxItem(Icon(), 'Vue',     f, f.Default?),
            Angular f => ComboBoxItem(Icon(), 'Angular', f, f.Default?)
        }),
        @use color = Label({
            @map f = framework.SelectedItem,
            f.Color
        }),
        @use Effect(DebugWatch('selected', framework.SelectedItem)),
        Window($('ComboBox'), Row(framework.Widget, color.Widget))
    })
}


